@import "global";
@import "functions";

// default
$default_background_normal: #{"" + internal_default(background)};
$default_background_insensitive: #{"" + internal_insensitive(internal_default(background))};
$default_background_backdrop: #{"" + internal_backdrop(internal_default(background))};
$default_background_backdrop_insensitive: #{"" + internal_insensitive(internal_backdrop(internal_default(background)))};
$default_foreground_normal: #{"" + internal_default(foreground)};
$default_foreground_insensitive: #{"" + internal_insensitive(internal_default(foreground))};
$default_foreground_backdrop: #{"" + internal_backdrop(internal_default(foreground))};
$default_foreground_backdrop_insensitive: #{"" + internal_insensitive(internal_backdrop(internal_default(foreground)))};
$default_border_normal: #{"" + internal_default(border)};
$default_border_insensitive: #{"" + internal_insensitive(internal_default(border))};
$default_border_backdrop: #{"" + internal_backdrop(internal_default(border))};
$default_border_backdrop_insensitive: #{"" + internal_insensitive(internal_backdrop(internal_default(border)))};
$default_warning: #{"" + internal_default(warning)};
$default_warning_backdrop: #{"" + internal_backdrop(internal_default(warning))};
$default_error: #{"" + internal_default(error)};
$default_error_backdrop: #{"" + internal_backdrop(internal_default(error))};
$default_success: #{"" + internal_default(success)};
$default_success_backdrop: #{"" + internal_backdrop(internal_default(success))};
$default_bulk: #{"" + internal_default(bulk)};

// selection
$selection_background_normal: #{"" + internal_selection(background)};
$selection_foreground_normal: #{"" + internal_selection(foreground)};
$selection_background_insensitive: #{"" + internal_insensitive(internal_selection(background))};
$selection_foreground_insensitive: #{"" + internal_insensitive(internal_selection(foreground))};
$selection_background_backdrop: #{"" + internal_backdrop(internal_selection(background))};
$selection_foreground_backdrop: #{"" + internal_backdrop(internal_selection(foreground))};

// widget
$widget_background_normal: #{"" + internal_widget(background)};
$widget_background_hover: #{"" + internal_widget(background-hover)};
$widget_background_active: #{"" + internal_widget(background-active)};
$widget_background_checked: #{"" + internal_widget(background-checked)};
$widget_background_insensitive: #{"" + internal_insensitive(internal_widget(background))};
$widget_background_backdrop: #{"" + internal_backdrop(internal_widget(background))};
$widget_background_backdrop_checked: #{"" + internal_backdrop(internal_widget(background-checked))};
$widget_background_backdrop_insensitive: #{"" + internal_insensitive(internal_backdrop(internal_widget(background)))};
$widget_foreground_normal: #{"" + internal_widget(foreground)};
$widget_foreground_hover: #{"" + internal_widget(foreground-hover)};
$widget_foreground_active: #{"" + internal_widget(foreground-active)};
$widget_foreground_checked: #{"" + internal_widget(foreground-checked)};
$widget_foreground_insensitive: #{"" + internal_insensitive(internal_widget(foreground))};
$widget_foreground_backdrop: #{"" + internal_backdrop(internal_widget(foreground))};
$widget_foreground_backdrop_checked: #{"" + internal_backdrop(internal_widget(foreground-checked))};
$widget_foreground_backdrop_insensitive: #{"" + internal_insensitive(internal_backdrop(internal_widget(foreground)))};
$widget_border_normal: #{"" + internal_widget(border)};
$widget_border_hover: #{"" + internal_widget(border-hover)};
$widget_border_focus: #{"" + internal_widget(border-focus)};
$widget_border_insensitive: #{"" + internal_insensitive(internal_widget(border))};
$widget_border_backdrop: #{"" + internal_backdrop(internal_widget(border))};
$widget_border_backdrop_insensitive: #{"" + internal_insensitive(internal_backdrop(internal_widget(border)))};

// bare
$bare_background_normal: #{"" + internal_bare(background)};
$bare_background_hover: #{"" + internal_bare(background-hover)};
$bare_background_active: #{"" + internal_bare(background-active)};
$bare_background_checked: #{"" + internal_bare(background-checked)};
$bare_background_insensitive: #{"" + internal_insensitive(internal_bare(background))};
$bare_background_backdrop: #{"" + internal_backdrop(internal_bare(background))};
$bare_background_backdrop_checked: #{"" + internal_backdrop(internal_bare(background-checked))};
$bare_background_backdrop_insensitive: #{"" + internal_insensitive(internal_backdrop(internal_bare(background)))};
$bare_foreground_normal: #{"" + internal_bare(foreground)};
$bare_foreground_hover: #{"" + internal_bare(foreground-hover)};
$bare_foreground_active: #{"" + internal_bare(foreground-active)};
$bare_foreground_checked: #{"" + internal_bare(foreground-checked)};
$bare_foreground_insensitive: #{"" + internal_insensitive(internal_bare(foreground))};
$bare_foreground_backdrop: #{"" + internal_backdrop(internal_bare(foreground))};
$bare_foreground_backdrop_checked: #{"" + internal_backdrop(internal_bare(foreground-checked))};
$bare_foreground_backdrop_insensitive: #{"" + internal_insensitive(internal_backdrop(internal_bare(foreground)))};

// window
$window_background_normal: #{"" + internal_window(background)};
$window_background_hover: #{"" + internal_window(background-hover)};
$window_background_insensitive: #{"" + internal_insensitive(internal_window(background))};
$window_background_backdrop: #{"" + internal_backdrop(internal_window(background))};
$window_background_backdrop_insensitive: #{"" + internal_insensitive(internal_backdrop(internal_window(background)))};
$window_foreground_normal: #{"" + internal_window(foreground)};
$window_foreground_insensitive: #{"" + internal_insensitive(internal_window(foreground))};
$window_foreground_backdrop: #{"" + internal_backdrop(internal_window(foreground))};
$window_foreground_backdrop_insensitive: #{"" + internal_insensitive(internal_backdrop(internal_window(foreground)))};
$window_border_normal: #{"" + internal_window(border)};
$window_border_insensitive: #{"" + internal_insensitive(internal_window(border))};
$window_border_backdrop: #{"" + internal_backdrop(internal_window(border))};
$window_border_backdrop_insensitive: #{"" + internal_insensitive(internal_backdrop(internal_window(border)))};

// view
$view_background_normal: #{"" + internal_view(background)};
$view_background_insensitive: #{"" + internal_insensitive(internal_view(background))};
$view_background_backdrop: #{"" + internal_backdrop(internal_view(background))};
$view_background_backdrop_insensitive: #{"" + internal_insensitive(internal_backdrop(internal_view(background)))};
$view_foreground_normal: #{"" + internal_view(foreground)};
$view_foreground_insensitive: #{"" + internal_insensitive(internal_view(foreground))};
$view_foreground_backdrop: #{"" + internal_backdrop(internal_view(foreground))};
$view_foreground_backdrop_insensitive: #{"" + internal_insensitive(internal_backdrop(internal_view(foreground)))};
$view_border_normal: #{"" + internal_view(border)};
$view_border_focus: #{"" + internal_view(border-focus)};
$view_border_insensitive: #{"" + internal_insensitive(internal_view(border))};
$view_border_backdrop: #{"" + internal_backdrop(internal_view(border))};
$view_border_backdrop_insensitive: #{"" + internal_insensitive(internal_backdrop(internal_view(border)))};

// title bar
$titlebar_background_normal: #{"" + internal_titlebar(background)};
$titlebar_background_insensitive: #{"" + internal_insensitive(internal_titlebar(background))};
$titlebar_background_backdrop: #{"" + internal_backdrop(internal_titlebar(background))};
$titlebar_background_backdrop_insensitive: #{"" + internal_insensitive(internal_backdrop(internal_titlebar(background)))};
$titlebar_foreground_normal: #{"" + internal_titlebar(foreground)};
$titlebar_foreground_insensitive: #{"" + internal_insensitive(internal_titlebar(foreground))};
$titlebar_foreground_backdrop: #{"" + internal_backdrop(internal_titlebar(foreground))};
$titlebar_foreground_backdrop_insensitive: #{"" + internal_insensitive(internal_backdrop(internal_titlebar(foreground)))};
$titlebar_border_normal: #{"" + internal_titlebar(border)};
$titlebar_border_insensitive: #{"" + internal_insensitive(internal_titlebar(border))};
$titlebar_border_backdrop: #{"" + internal_backdrop(internal_titlebar(border))};
$titlebar_border_backdrop_insensitive: #{"" + internal_insensitive(internal_backdrop(internal_titlebar(border)))};

// flags
$special_button_default_normal: #{"" + internal_special_button(default)};
$special_button_default_hover: #{"" + internal_special_button(default-hover)};
$special_button_default_active: #{"" + internal_special_button(default-active)};
$special_button_default_insensitive: #{"" + internal_insensitive(internal_widget(background))};

$special_button_warnning_normal: #{"" + internal_special_button(warnning)};
$special_button_warnning_hover: #{"" + internal_special_button(warnning-hover)};
$special_button_warnning_active: #{"" + internal_special_button(warnning-active)};
$special_button_warnning_insensitive: #{"" + internal_insensitive(internal_widget(background))};

// === Flag ===
//NOTE:此处需要修改，.colors之中定义的Success为绿色，应该是错误的，而且其他类型也并未有其他状态的值
Flag {
  Warning: $default_warning;
  Error: $default_error;
  Success: $default_success;
}

// === QPalette-兼容QPalette ===
Palette:active {
  Window: $window_background_normal;
  WindowText: $window_foreground_normal;

  Base: $view_background_normal;
  Text: $view_foreground_normal;

  Button: $widget_background_normal;
  ButtonText: $widget_foreground_normal;

  Highlight: $selection_background_normal;
  //HighlightedText: $selection_foreground_normal;
  HighlightedText: #ffffff;

  ToolTipBase: $window_background_normal;
  ToolTipText: $window_foreground_normal;
}

//QPalette inacitve窗口的调色盘，暂时未使用
Palette {
  Window: $window_background_backdrop;
  WindowText: $window_foreground_backdrop;

  Base: $view_background_backdrop;
  Text: $view_foreground_backdrop;

  Button: $widget_background_backdrop;
  ButtonText: $widget_foreground_backdrop;

  Highlight: $selection_background_backdrop;
  HighlightedText: $selection_foreground_backdrop;

  ToolTipBase: $window_background_backdrop;
  ToolTipText: $window_foreground_backdrop;
}

Palette:disabled {
  Window: $window_background_insensitive;
  WindowText: $window_foreground_insensitive;

  Base: $view_background_insensitive;
  Text: $view_foreground_insensitive;

  Button: $widget_background_insensitive;
  ButtonText: $widget_foreground_insensitive;

  Highlight: $selection_background_insensitive;
  HighlightedText: $selection_foreground_insensitive;

  ToolTipBase: $window_background_insensitive;
  ToolTipText: $window_foreground_insensitive;
}

// === Window ===
Window {
  Background: $window_background_normal;
  Foreground: $window_foreground_normal;
  Border: $window_border_normal;
}

Window:hover {
  Background: $window_background_hover;
}

Window:disabled {
  Background: $window_background_insensitive;
  Foreground: $window_foreground_insensitive;
  Border: $window_border_insensitive;
}

// === Bare ===
Bare {
  Background: $bare_background_normal;
  Foreground: $bare_foreground_normal;
}

Bare:pressed {
  Background: $bare_background_active;
  Foreground: $bare_foreground_active;
}

Bare:hover {
  Background: $bare_background_hover;
  Foreground: $bare_foreground_hover;
}

Bare:checked {
  Background: $bare_background_checked;
  Foreground: $bare_foreground_checked;
}

Bare:disabled {
  Background: $bare_background_insensitive;
  Foreground: $bare_foreground_insensitive;
}

// === widget ===
Widget {
  Background: $widget_background_normal;
  Foreground: $widget_foreground_normal;
  Border: $widget_border_normal;
}

Widget:hover {
  Background: $widget_background_hover;
  Foreground: $widget_foreground_hover;
  //Border: $widget_border_hover;
}

Widget:pressed {
  Background: $widget_background_active;
  Foreground: $widget_foreground_active;
  Border: $widget_border_focus;
}

Widget:checked,
Widget:selected {
  Background: $widget_background_checked;
  Foreground: $widget_foreground_checked;
  Border: $widget_border_focus;
}

Widget:disabled {
  Background: $widget_background_insensitive;
  Foreground: $widget_foreground_insensitive;
  Border: $widget_border_insensitive;
}

// === view ===
View {
  Background: $view_background_normal;
  Foreground: $view_foreground_normal;
  Border: $view_border_normal;
}

View:focus {
  Border: $view_border_focus;
}

View:disabled {
  Background: $view_background_insensitive;
  Foreground: $view_foreground_insensitive;
  Border: $view_border_insensitive;
}

// === selection ===
Selection {
  Background: $selection_background_normal;
  Foreground: $selection_foreground_normal;
}

Selection:disabled {
  Background: $selection_background_insensitive;
  Foreground: $selection_foreground_insensitive;
}

// === title bar ===
TitleBar {
  Background: $titlebar_background_normal;
  Foreground: $titlebar_foreground_normal;
  Border: $titlebar_border_normal;
}

TitleBar:disabled {
  Background: $titlebar_background_insensitive;
  Foreground: $titlebar_foreground_insensitive;
  Border: $titlebar_border_insensitive;
}


/** --- 提供给KiranStyle直接使用的相关属性 --- **/
Frame {
  Background: $window_background_normal;
  Border: $window_border_normal;
}

Frame:disabled {
  Background: $window_background_insensitive;
  Border: $window_border_insensitive;
}

Button {
  Background: $widget_background_normal;
  Border: $widget_border_normal;
}

Button:hover {
  Background: $widget_background_hover;
}

Button:pressed {
  Background: $widget_background_active;
}

Button:disabled {
  Background: $widget_background_insensitive;
  Border: $widget_border_insensitive;
}

SpecialButton {
  DefaultBackground: $special_button_default_normal;
  WarnningBackground: $special_button_warnning_normal;
}

SpecialButton:hover {
  DefaultBackground: $special_button_default_hover;
  WarnningBackground: $special_button_warnning_hover;
}

SpecialButton:pressed {
  DefaultBackground: $special_button_default_active;
  WarnningBackground: $special_button_warnning_active;
}

SpecialButton:disabled {
  DefaultBackground: $special_button_default_insensitive;
  WarnningBackground: $special_button_warnning_insensitive;
}

Edit {
  Background: $widget_background_normal;
  Foreground: $view_foreground_normal;
  Border: $view_border_normal;
}

Edit:focus {
  Border: $view_border_focus;
}

Edit:disabled {
  Background: $widget_background_insensitive;
  Border: transparent;
}

Indicator {
  Arrow: $widget_foreground_normal;
}

Indicator:disabled {
  Arrow: $widget_foreground_insensitive;
}

Combo {
  Background: $widget_background_normal;
  Border: $widget_border_normal;
}

Combo:hover {
  Background: $widget_background_hover;
}

Combo:pressed {
  Background: $widget_background_active;
}

Combo:disabled {
  Background: $widget_background_insensitive;
  Border: transparent;
}

ItemView {
  Branch: $widget_border_normal;
}

ItemView:disabled {
  Branch: $widget_border_insensitive;
}

MenuBar {
  ItemBackground: $window_background_normal;
  EmptyAreaBackground: $window_background_normal;
}

MenuBar:hover {
  ItemBackground: $widget_background_hover;
}

MenuBar:pressed {
  ItemBackground: $widget_background_active;
}

MenuBar:disabled {
  ItemBackground: $window_background_insensitive;
  EmptyAreaBackground: $window_background_insensitive;
}

Progress {
  Groove: $bare_background_normal;
  Content: $bare_foreground_checked;
}

Progress:disabled {
  Groove: $bare_background_insensitive;
  Content: $bare_foreground_insensitive;
}

Scroll {
  Slider: $bare_background_normal;
}

Scroll:hover {
  Slider: $bare_background_hover;
}

Scroll:pressed {
  Slider: $bare_background_checked;
}

Scroll:disabled {
  Slider: $bare_background_insensitive;
}

Slider {
  Groove: $bare_background_normal;
  Content: $bare_foreground_checked;
  HandleBorder: white;
  HandleBackground: $bare_foreground_checked;
}

Slider:pressed {
  HandleBorder: white;
  HandleBackground: white;
}

Slider:disabled {
  Groove: $bare_background_insensitive;
  Content: $bare_foreground_insensitive;
  HandleBorder: $bare_foreground_insensitive;
  HandleBackground: $bare_foreground_insensitive;
}

SpinBox {
  Background: $widget_background_normal;
  Border: $widget_border_normal;
  SignColor: $widget_foreground_normal;
}

SpinBox:hover {
  Background: $widget_background_hover;
  Border: $widget_border_hover;
}

SpinBox:pressed {
  Background: $widget_background_active;
}

SpinBox:disabled {
  Background: $widget_background_insensitive;
  Border: transparent;
  SignColor: $widget_foreground_insensitive;
}

Bulk {
  Background: $default_bulk
}